home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 May: Tool Chest / Dev.CD May 97 TC.toast / Sample Code / Snippets / Toolbox / MovableModal / MModal 7.0.r < prev    next >
Encoding:
Text File  |  1993-01-18  |  7.1 KB  |  325 lines  |  [TEXT/MPS ]

  1. #define SystemSevenOrLater 1
  2. #include "Types.r"
  3. resource 'MENU' (131) {
  4.     131,
  5.     textMenuProc,
  6.     0x7FFFFFD7,
  7.     enabled,
  8.     "Test Stuff",
  9.     {    /* array: 1 elements */
  10.         /* [1] */
  11.         "Open a Moveable Modeless Dialog", noIcon, noKey, noMark, plain
  12.     }
  13. };
  14.  
  15. resource 'MENU' (128, preload) {
  16.     128,
  17.     textMenuProc,
  18.     0x7FFFFFFD,
  19.     enabled,
  20.     apple,
  21.     {    /* array: 2 elements */
  22.         /* [1] */
  23.         "About", noIcon, noKey, noMark, plain,
  24.         /* [2] */
  25.         "-", noIcon, noKey, noMark, plain
  26.     }
  27. };
  28.  
  29. resource 'MENU' (129, preload) {
  30.     129,
  31.     textMenuProc,
  32.     0xE00,
  33.     enabled,
  34.     "File",
  35.     {    /* array: 10 elements */
  36.         /* [1] */
  37.         "New", noIcon, "N", noMark, plain,
  38.         /* [2] */
  39.         "Open", noIcon, "O", noMark, plain,
  40.         /* [3] */
  41.         "Close", noIcon, "W", noMark, plain,
  42.         /* [4] */
  43.         "Save", noIcon, "S", noMark, plain,
  44.         /* [5] */
  45.         "Save As...", noIcon, noKey, noMark, plain,
  46.         /* [6] */
  47.         "-", noIcon, noKey, noMark, plain,
  48.         /* [7] */
  49.         "Page Setup...", noIcon, noKey, noMark, plain,
  50.         /* [8] */
  51.         "Print...", noIcon, "P", noMark, plain,
  52.         /* [9] */
  53.         "-", noIcon, noKey, noMark, plain,
  54.         /* [10] */
  55.         "Quit", noIcon, "Q", noMark, plain
  56.     }
  57. };
  58.  
  59. resource 'MENU' (130, preload) {
  60.     130,
  61.     textMenuProc,
  62.     0x3400,
  63.     enabled,
  64.     "Edit",
  65.     {    /* array: 6 elements */
  66.         /* [1] */
  67.         "Undo", noIcon, "Z", noMark, plain,
  68.         /* [2] */
  69.         "-", noIcon, noKey, noMark, plain,
  70.         /* [3] */
  71.         "Cut", noIcon, "X", noMark, plain,
  72.         /* [4] */
  73.         "Copy", noIcon, "C", noMark, plain,
  74.         /* [5] */
  75.         "Paste", noIcon, "V", noMark, plain,
  76.         /* [6] */
  77.         "Clear", noIcon, noKey, noMark, plain
  78.     }
  79. };
  80.  
  81. resource 'DITL' (128, purgeable) {
  82.     {    /* array DITLarray: 4 elements */
  83.         /* [1] */
  84.         {164, 115, 184, 185},
  85.         Button {
  86.             enabled,
  87.             "OK"
  88.         },
  89.         /* [2] */
  90.         {5, 10, 43, 290},
  91.         StaticText {
  92.             disabled,
  93.             "The Simplest Shell"
  94.         },
  95.         /* [3] */
  96.         {76, 3, 154, 301},
  97.         StaticText {
  98.             disabled,
  99.             "FredWare from Apple Developer Technical "
  100.             "Support, ADS group.\nCopyright ©  1991 Ap"
  101.             "ple Computer Inc.\nWritten by C.K. Haun ("
  102.             "<TR>)."
  103.         },
  104.         /* [4] */
  105.         {53, 82, 71, 227},
  106.         StaticText {
  107.             disabled,
  108.             "version 1.0d1"
  109.         }
  110.     }
  111. };
  112.  
  113. resource 'DITL' (129, purgeable) {
  114.     {    /* array DITLarray: 2 elements */
  115.         /* [1] */
  116.         {170, 90, 190, 148},
  117.         Button {
  118.             enabled,
  119.             "OK"
  120.         },
  121.         /* [2] */
  122.         {10, 40, 62, 204},
  123.         StaticText {
  124.             disabled,
  125.             "Help information should go here"
  126.         }
  127.     }
  128. };
  129.  
  130. resource 'DITL' (130, purgeable) {
  131.     {    /* array DITLarray: 3 elements */
  132.         /* [1] */
  133.         {80, 100, 100, 158},
  134.         Button {
  135.             enabled,
  136.             "Exit"
  137.         },
  138.         /* [2] */
  139.         {10, 80, 27, 237},
  140.         StaticText {
  141.             disabled,
  142.             "Bad System Version!"
  143.         },
  144.         /* [3] */
  145.         {50, 25, 66, 232},
  146.         StaticText {
  147.             disabled,
  148.             "Requires System 7 or greater."
  149.         }
  150.     }
  151. };
  152.  
  153. resource 'ALRT' (128, purgeable) {
  154.     {40, 40, 229, 363},
  155.     128,
  156.     {    /* array: 4 elements */
  157.         /* [1] */
  158.         OK, visible, sound1,
  159.         /* [2] */
  160.         OK, visible, sound1,
  161.         /* [3] */
  162.         OK, visible, sound1,
  163.         /* [4] */
  164.         OK, visible, sound1
  165.     },
  166.     alertPositionMainScreen
  167. };
  168.  
  169. resource 'ALRT' (130, purgeable) {
  170.     {40, 40, 149, 296},
  171.     130,
  172.     {    /* array: 4 elements */
  173.         /* [1] */
  174.         OK, visible, sound1,
  175.         /* [2] */
  176.         OK, visible, sound1,
  177.         /* [3] */
  178.         OK, visible, sound1,
  179.         /* [4] */
  180.         OK, visible, sound1
  181.     },
  182.     alertPositionMainScreen
  183. };
  184.  
  185. resource 'WIND' (128, purgeable) {
  186.     {44, 4, 242, 498},
  187.     documentProc,
  188.     visible,
  189.     noGoAway,
  190.     0x0,
  191.     "Simple",
  192.     staggerParentWindow
  193. };
  194.  
  195. resource 'WIND' (129) {
  196.     {40, 40, 170, 286},
  197.     movableDBoxProc,
  198.     invisible,
  199.     noGoAway,
  200.     0x0,
  201.     "Sample Moveable Modal",
  202.     alertPositionMainScreen
  203. };
  204.  
  205. data 'TEXT' (128) {
  206.     $"5468 6973 2073 616D 706C 6520 7368 6F77"            /* This sample show */
  207.     $"2061 2076 6572 7920 7369 6D70 6C65 2069"            /*  a very simple i */
  208.     $"6D70 6C65 6D65 6E74 6174 696F 6E20 6F66"            /* mplementation of */
  209.     $"2074 6865 2037 2E30 204D 6F76 6561 626C"            /*  the 7.0 Moveabl */
  210.     $"6520 4D6F 6461 6C20 4469 616C 6F67 2E0D"            /* e Modal Dialog.¬ */
  211.     $"5369 6E63 6520 796F 7520 6361 6E27 7420"            /* Since you can't  */
  212.     $"6361 6C6C 204D 6F64 616C 4469 616C 6F67"            /* call ModalDialog */
  213.     $"206F 6E20 6120 4D4D 6F64 616C 2C20 796F"            /*  on a MModal, yo */
  214.     $"7520 6861 7665 2074 6F20 646F 2074 6865"            /* u have to do the */
  215.     $"2061 6374 7561 6C20 6869 7420 7265 7374"            /*  actual hit rest */
  216.     $"7269 6374 696E 6720 616E 6420 6D65 6E75"            /* ricting and menu */
  217.     $"2064 696D 6D69 6E67 2079 6F75 7273 656C"            /*  dimming yoursel */
  218.     $"662C 2062 7574 2069 7427 7320 6E6F 7420"            /* f, but it's not  */
  219.     $"7265 616C 6C79 206D 7563 6820 6D6F 7265"            /* really much more */
  220.     $"206F 6620 6120 6368 6F72 652E 2020 416C"            /*  of a chore.  Al */
  221.     $"6C20 796F 7520 6E65 6564 2074 6F20 6164"            /* l you need to ad */
  222.     $"6420 6973 206F 6E65 206C 696C 2720 676C"            /* d is one lil' gl */
  223.     $"6F62 616C 2074 6861 7420 7465 6C6C 7320"            /* obal that tells  */
  224.     $"796F 7520 7768 656E 2079 6F75 2776 6520"            /* you when you've  */
  225.     $"676F 7420 6120 4D4D 6F64 616C 2075 702C"            /* got a MModal up, */
  226.     $"2061 6E64 2074 6869 6E67 7320 7769 6C6C"            /*  and things will */
  227.     $"2062 6520 776F 6E64 6572 6675 6C2E 0D0D"            /*  be wonderful.¬¬ */
  228.     $"5365 6C65 6374 2027 4F70 656E 204D 6F76"            /* Select 'Open Mov */
  229.     $"6561 626C 6520 4D6F 6461 6C27 2066 726F"            /* eable Modal' fro */
  230.     $"6D20 7468 6520 5465 7374 2053 7475 6666"            /* m the Test Stuff */
  231.     $"206D 656E 7520 746F 2077 6174 6368 2069"            /*  menu to watch i */
  232.     $"7420 776F 726B 2E"                                  /* t work. */
  233. };
  234.  
  235. data 'TEXT' (129) {
  236.     $"5468 6973 2069 7320 6120 6D6F 7665 6162"            /* This is a moveab */
  237.     $"6C65 206D 6F64 616C 2064 6961 6C6F 672E"            /* le modal dialog. */
  238.     $"2020 436C 6963 6B20 696E 2074 6861 7420"            /*   Click in that  */
  239.     $"6275 7474 6F6E 2074 6865 7265 2074 6F20"            /* button there to  */
  240.     $"6D61 6B65 2069 7420 676F 2061 7761 792E"            /* make it go away. */
  241. };
  242.  
  243. data 'TEXT' (130) {
  244.     $"4772 6174 7569 746F 7573 2053 6563 6F6E"            /* Gratuitous Secon */
  245.     $"6420 5769 6E64 6F77 2E20 2049 676E 6F72"            /* d Window.  Ignor */
  246.     $"6520 6D65 2C20 706C 6561 7365 2E"                   /* e me, please. */
  247. };
  248.  
  249. resource 'STR#' (128) {
  250.     {    /* array StringArray: 1 elements */
  251.         /* [1] */
  252.         "Another Window Fer Fun"
  253.     }
  254. };
  255.  
  256. resource 'STR#' (129) {
  257.     {    /* array StringArray: 2 elements */
  258.         /* [1] */
  259.         "Close Moveable Modal Dialog",
  260.         /* [2] */
  261.         "Open Moveable Modal Dialog"
  262.     }
  263. };
  264.  
  265. resource 'MBAR' (128) {
  266.     {    /* array MenuArray: 4 elements */
  267.         /* [1] */
  268.         128,
  269.         /* [2] */
  270.         129,
  271.         /* [3] */
  272.         130,
  273.         /* [4] */
  274.         131
  275.     }
  276. };
  277.  
  278. resource 'SIZE' (-1) {
  279.     reserved,
  280.     acceptSuspendResumeEvents,
  281.     reserved,
  282.     canBackground,
  283.     multiFinderAware,
  284.     backgroundAndForeground,
  285.     dontGetFrontClicks,
  286.     ignoreChildDiedEvents,
  287.     is32BitCompatible,
  288.     isHighLevelEventAware,
  289.     localAndRemoteHLEvents,
  290.     notStationeryAware,
  291.     dontUseTextEditServices,
  292.     reserved,
  293.     reserved,
  294.     reserved,
  295.     50000,
  296.     50000
  297. };
  298.  
  299. resource 'STR ' (128) {
  300.     "Simple Help..."
  301. };
  302.  
  303. resource 'DLOG' (129, "Sample Help Dialog", purgeable) {
  304.     {34, 40, 234, 280},
  305.     dBoxProc,
  306.     visible,
  307.     goAway,
  308.     0x0,
  309.     129,
  310.     "",
  311.     alertPositionMainScreen
  312. };
  313.  
  314. resource 'CNTL' (128) {
  315.     {99, 55, 128, 185},
  316.     0,
  317.     visible,
  318.     0,
  319.     0,
  320.     pushButProc,
  321.     0,
  322.     "Close Me"
  323. };
  324.  
  325.